﻿		<div class="container">
					<div class="navbar-brand col-sm-6">
					<span style="margin-left:100px;color: #fff">壹果企画(北京)科技有限公司-运营系统</span>
					
					
					<!-- /COMPANY LOGO -->
					
					<!-- SIDEBAR COLLAPSE -->
					<div id="sidebar-collapse" class="sidebar-collapse btn">
						<i class="fa fa-bars" 
							data-icon1="fa fa-bars" 
							data-icon2="fa fa-bars" ></i>
					</div>
					<!-- /SIDEBAR COLLAPSE -->
				</div>
				
				<!-- BEGIN TOP NAVIGATION MENU -->					
				<ul class="nav navbar-nav pull-right">				
					<!-- BEGIN USER LOGIN  -->
					<li class="dropdown user" id="header-user">
						<a href="#" style="color: #fff">
							
							<span class="username"  style="margin-left:100px;color: #fff;font-size: 16px;"></span>							
						</a>
					</li>
					<!-- END USER LOGIN -->
					<!-- BEGIN USER LOGOUT -->	
					<li class="dropdown logout" id="header-notification">
						<a href="../pages/login.html" class="dropdown-toggle" data-toggle="dropdown">
						<i class="fa fa-power-off"></i>退出
						</a>
					</li>
					<!-- END USER LOGOUT -->
				</ul>
				<!-- END TOP NAVIGATION MENU -->
		</div>
		<!-- login -->
		<div class="modal fade" id="box-login" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
					<div class="modal-dialog">
						<div class="modal-content">
							<div class="modal-header">
								<h4 class="modal-title">登录</h4>
							</div>
								<div class="modal-body">
								<form role="form">
								    <div class="row col-md-offset-2">
													  <div class="col-md-12" style="display: inline-flex">							
														<i class="fa fa-user" style="margin-top:15px;margin-right:15px"></i>
														<input type="text" class="form-control" name="username" style="height: 40px;width:200px" >
														<div class="text-danger col-md-6" style="display:none;margin-top:10px"><span>请输入用户名</span></div>
													  </div>
													  
													  </div>
													<div class=" row col-md-offset-2" style="margin-top:15px" >
													  <div class="col-md-12" style="display: inline-flex"> 									
														<i class="fa fa-lock" style="margin-top:15px;margin-right:15px"></i>
														<input type="password" class="form-control" name="password" style="height: 40px;width:200px">
														<div class="text-danger" style="display:none;margin-top: 10px;margin-left:20px"><span>请输入密码</span></div>
													  </div>	
													 </div>
													 <div class=" row col-md-offset-2" style="margin-top:5px;height:30px" >														 
														    <div class="text-danger error" style="margin-top: 10px;margin-left:35px;margin-bottom:10px"></div>
														
													 </div>
													   <div class=" row col-md-offset-3">							  
														  <div class="form-group">									
															<button type="submit" class="btn btn-danger" style="width: 120px">登录</button>
														  </div>
									  				 </div>
									   	</form>
									</div>
								
							</div>
					</div>
				</div>
				</div>
				
				<!-- end login -->
				
	<script>
			var submit=function(e){	     
		     e.preventDefault();
		     var username=$("[name=username]").val();
		     var password=$("[name=password]").val();
		     $(".text-danger").hide();
		     if(username=="")
		     {
		        $("[name=username]").next("div").show();
		        return false;
		     }
		     if(password=="")
		     {
		        $("[name=password").next("div").show();
		        return false;
		     }
		     
		          $.ajax({
						type: "post",
						url: App.getContextPath() + "admin/login.do",
						data:{username:username,password:password},
						async: true,
						success: function(result) {
							if(result.key=="LOGIN_SUCCESS"){
							  $("#box-login").modal("hide");
							  window.location.reload();
							}else{
							   $(".error").html(result.val);							  
							}
						}
					});
		 
		 }
		 
		 $("#box-login").find("button").unbind('click').click(submit);
		 
				</script>
	